﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using Microsoft.DeepZoomTools;

namespace TechPath.DCM.Sharepoint.Services.Util
{
    internal static partial class Config
    {
        public static string PublicRootTilePath
        {
            get
            {
                return ConfigurationManager.AppSettings["PublicRootTilePath"];
            }
        }

        public static string PrivateRootTilePath
        {
            get
            {
                return ConfigurationManager.AppSettings["PrivateRootTilePath"];
            }
        }

        public static string MissingImageKey
        {
            get
            {
                return ConfigurationManager.AppSettings["MissingImageKey"];
            }
        }

        public static int TileSize
        {
            get
            {
                return int.Parse(ConfigurationManager.AppSettings["TileSize"]);
            }
        }

        public static ImageFormat TileFormat
        {
            get
            {
                return (ImageFormat)Enum.Parse(typeof(ImageFormat), ConfigurationManager.AppSettings["TileFormat"]);
            }
        }

        public static double TileImageQuality
        {
            get
            {
                return double.Parse(ConfigurationManager.AppSettings["TileImageQuality"]);
            }
        }

        public static int TileOverlapSize
        {
            get
            {
                return int.Parse(ConfigurationManager.AppSettings["TileOverlapSize"]);
            }
        }

        public static ServerFormats ServerFormat
        {
            get
            {
                if(bool.Parse(ConfigurationManager.AppSettings["UseSmoothStreamingFormat"]))
                    return ServerFormats.SmoothStreaming;
                else
                    return ServerFormats.Default;
            }
        }

        public static int CollectionLevel
        {
            get
            {
                return int.Parse(ConfigurationManager.AppSettings["CollectionLevel"]);
            }
        }

        public static string DbConnectionString
        {
            get
            {
                return ConfigurationManager.ConnectionStrings["DzDatabase"].ConnectionString;
            }
        }

        public static bool SubstituteMissingImage
        {
            get
            {
                return bool.Parse(ConfigurationManager.AppSettings["SubstituteMissingImage"]);
            }
        }
    }
}
